<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<%@	taglib prefix="c"			uri="http://java.sun.com/jsp/jstl/core"%>
<%@	taglib prefix="fmt"		uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@	taglib prefix="fn"		uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring"	uri="http://www.springframework.org/tags" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});
</script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<title>중고마트</title>
</head>
<body>
<section id="favorite" data-role="page">
    <header data-role="header" data-position="fixed">
		<a href="index.do" data-role="button" data-icon="home" data-iconpos="notext" data-inline="true">Home</a>
		<h1 style="text-overflow:clip;margin-left:10%;margin-right:10%">내 관심상품 - 관심상품 상세</h1>
		<a id="logout" data-role="button" href="logout.do" class="ui-btn-right" data-ajax="false">로그아웃</a>
	</header>
    <div data-role="content">
        <h2>키워드: ${ favorite.title }</h2>
        <h3>카테고리: ${ favorite.category }</h3>
        <h3>등록일: ${ favorite.str_dt }</h3>
        <h3>희망가격: ${ favorite.min_price }원~${ favorite.max_price }원</h3>
        <h3>연락처: ${ favorite.contact }</h3>
    </div>

	<hr/>

	<c:if test="${ product != null }">
	<div class="product">
   		<div class="product-inner">
   		<p>${ product.userid }님이 등록하신 ${ product.title } 상품과 거래가 진행 중 입니다.</p>
   		</div>
    </div>
	</c:if>
	
    <footer data-role="footer" data-position="fixed">
    	<div data-role="navbar" data-iconpos="left">
			<ul>
				<li><a id="products" href="products.do" data-icon="grid" rel="external">전체 상품</a></li>
				<li><a id="myProducts" href="myProducts.do" data-icon="bars" rel="external">내 상품</a></li>
				<li><a id="myFavorites" href="myFavorites.do" data-icon="star" rel="external">내 관심상품</a></li>
			</ul>
		</div><!-- /navbar -->
    </footer>
</section>
</body>
<style>
.product { border:2px solid silver; margin:15px; }
.product-inner { margin:5px; }
hr { border-top:1px solid #9C9C9C; border-bottom:1px solid #F6F6F6; margin: 10px;}
</style>
<script>
$(document).bind('pageinit', function() {
	var sectionId = $('section').attr('id');
	
	if ( sectionId == "favorite" ) {
		$('#myFavorites').addClass("ui-btn-active");
	} else if ( sectionId == "products" ) {
		$('#products').addClass("ui-btn-active");
	} else {
		$('#myProducts').addClass("ui-btn-active");
	}
});
</script>
</html>